Group Selector
CSS Group Selector
- The grouping selector is used to select all the elements with the same style definitions.
- Grouping selector is used to minimize the code. Commas are used to separate each selector in grouping.
Syntax:
selctors {
property : value;
}
For example:
<!DOCTYPE html>
<html>
<head>
<style>
h1, h2, p {
text-align: center;
color: red;
}
</style>
</head>
<body>
<h1>Hello Cristle Academy.com</h1>
<h2>Hello Cristle Academy.com (In smaller font)</h2>
<p>This is a paragraph.</p> </body>
</html>